﻿using System;

namespace XamlMvp
{
    public static class UriFormats
    {
        public static Uri ViewUri(string view)
        {
            const string viewArg = "view";
            const string format = "/{0}";

            if (view == null) throw new ArgumentNullException(viewArg);

            return new Uri(string.Format(format, view), System.UriKind.Relative);
        }

        public static Uri NounVerbUri(string noun, string verb)
        {
            const string nounArg = "noun";
            const string verbArg = "verb";
            const string format = "/{0}/{1}";

            if (noun == null) throw new ArgumentNullException(nounArg);
            if (verb == null) throw new ArgumentNullException(verbArg);

            return new Uri(string.Format(format, noun, verb), System.UriKind.Relative);
        }
    }
}
